package nlp;

public class FrequencyFeature implements Feature {
	/**
	 * 
	 */
	private static final long serialVersionUID = -8097330358743485679L;
	protected String token;
	protected double frequency;

	public FrequencyFeature(String token, double value) {
		this.setToken(token);
		this.frequency = value;
	}

	@Override
	public String GetFeatureName() {
		return "FreqFeat_" + token;
	}

	@Override
	public String GetFeatureType() {
		return "Real";
	}

	@Override
	public Object GetValue() {
		// Scale all frequencies by 10^5
		return frequency * 100000;
	}

	public void setToken(String token) {
		this.token = token;
	}

	public String getToken() {
		return token;
	}

	public double getFrequency() {
		return frequency;
	}

	public void setFrequency(double frequency) {
		this.frequency = frequency;
	}
}